MATLAB Matrix Algebra by César Pérez López

MATLAB Matrix Algebra by César Pérez López

Author:César Pérez López
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


EXERCISE 3-6

Generate a three-dimensional array containing the first eight positive natural numbers and whose three indices vary from 1 to 2. Access its operands and display its internal structure.

>> pretty(sym(maple('tridimen:=array(1..2,1..2,1..2,[[[1,2],[3,4]],[[5,6],[7,8]]])')))

>> pretty(sym(maple('tridimen')))

array(1 .. 2, 1 .. 2, 1 .. 2, [

(1, 1, 1) = 1

(1, 1, 2) = 2

(1, 2, 1) = 3

(1, 2, 2) = 4

(2, 1, 1) = 5

(2, 1, 2) = 6

(2, 2, 1) = 7

(2, 2, 2) = 8

])

>> pretty(sym(maple('op(eval(tridimen)) ')))

[1 .. 2, 1 .. 2, 1 .. 2], [(1, 1, 1) = 1, (1, 1, 2)= 2, (1, 2, 1)= 3,

(1, 2, 2)=4, (2, 1, 1)=5, (2, 1, 2) = 6, (2, 2, 1) = 7, (2, 2, 2) = 8]

>> pretty(sym(maple('op(1,eval(tridimen)) ')))

[1 .. 2 1 .. 2 1 .. 2]

>> pretty(sym(maple('op(2,eval(tridimen)) ')))

[(1, 1, 1) = 1 (1, 1, 2) = 2, (1, 2, 1) = 3, (1, 2, 2) = 4,]

(2, 1, 1) = 5, (2, 1, 2) = 6, (2, 2, 1) = 7 (2, 2, 2) = 8]



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.